package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.RegistrationTypeMapper;
import com.ruoyi.system.domain.RegistrationType;
import com.ruoyi.system.service.IRegistrationTypeService;

import javax.annotation.Resource;

/**
 * 挂号类型Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-26
 */
@Service
public class RegistrationTypeServiceImpl implements IRegistrationTypeService 
{
    @Resource
    private RegistrationTypeMapper registrationTypeMapper;

    /**
     * 查询挂号类型
     * 
     * @param id 挂号类型主键
     * @return 挂号类型
     */
    @Override
    public RegistrationType selectRegistrationTypeById(Long id)
    {
        return registrationTypeMapper.selectRegistrationTypeById(id);
    }

    /**
     * 查询挂号类型列表
     * 
     * @param registrationType 挂号类型
     * @return 挂号类型
     */
    @Override
    public List<RegistrationType> selectRegistrationTypeList(RegistrationType registrationType)
    {
        return registrationTypeMapper.selectRegistrationTypeList(registrationType);
    }

    /**
     * 新增挂号类型
     * 
     * @param registrationType 挂号类型
     * @return 结果
     */
    @Override
    public int insertRegistrationType(RegistrationType registrationType)
    {
        registrationType.setCreateTime(DateUtils.getNowDate());
        return registrationTypeMapper.insertRegistrationType(registrationType);
    }

    /**
     * 修改挂号类型
     * 
     * @param registrationType 挂号类型
     * @return 结果
     */
    @Override
    public int updateRegistrationType(RegistrationType registrationType)
    {
        registrationType.setUpdateTime(DateUtils.getNowDate());
        return registrationTypeMapper.updateRegistrationType(registrationType);
    }

    /**
     * 批量删除挂号类型
     * 
     * @param ids 需要删除的挂号类型主键
     * @return 结果
     */
    @Override
    public int deleteRegistrationTypeByIds(Long[] ids)
    {
        return registrationTypeMapper.deleteRegistrationTypeByIds(ids);
    }

    /**
     * 删除挂号类型信息
     * 
     * @param id 挂号类型主键
     * @return 结果
     */
    @Override
    public int deleteRegistrationTypeById(Long id)
    {
        return registrationTypeMapper.deleteRegistrationTypeById(id);
    }

    @Override
    public List<RegistrationType> selectAll() {
        return registrationTypeMapper.selectAll();
    }
}
